﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;

namespace Tank
{
    class SoundManger
    {
        private static SoundPlayer startPlayer = new SoundPlayer();
        private static SoundPlayer addPlayer = new SoundPlayer();
        private static SoundPlayer balstlayer = new SoundPlayer();
        private static SoundPlayer firelayer = new SoundPlayer();
        private static SoundPlayer hitlayer = new SoundPlayer();
        public static void InitSound()
        {
            startPlayer.Stream = Properties.Resources.start;
            addPlayer.Stream = Properties.Resources.add;
            balstlayer.Stream = Properties.Resources.blast;
            firelayer.Stream = Properties.Resources.fire;
            hitlayer.Stream = Properties.Resources.hit;

        }
        public static void PlayStart()
        {
            // 声音实例
            //SoundPlayer sp = new SoundPlayer();
            //// 声音源
            //sp.Stream = Properties.Resources.start;
            startPlayer.Play();
        }
        public static void PlayAdd()
        {
            addPlayer.Play();
        }
        public static void Balstlayer()
        {
            balstlayer.Play();
        }
        public static void Firelayer()
        {
            firelayer.Play();
        }
        public static void Hitlayer()
        {
            hitlayer.Play();
        }
    }
}
